﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>
<%
if qingtian.bbs<>true then
	Response.Redirect "/index.asp?sid="&sidd
	Response.end
end if
	dim id,url,urls
    		id = Request.QueryString("id")    
    		If id = "" Then id = 1
   		If Not IsNumeric(id) Then id = 1
    		id = CLng(id)
    		If id < 0 Then id = 1
                url=Request.QueryString("url") 
                urls=replace(url,"@@","&amp;")
select case v
case "0"
we0="<br/>"
hr="-------------<br/>"
Randomize()
book="跳到第<input name='Page' format='*N' size='2' maxlength='5'/><anchor>页<go href='bannji.asp?id="&id&"&amp;url="&url&"&amp;sid="&sidd&"&amp;run="& Int((9999) * Rnd() + 1) &"' method='post'><postfield name=""Page"" value=""$(Page:n)"" /></go></anchor><br/>"
%>
<card title="栏目分类管理"><p align="<%=qingtian.px%>">
<%
case "1"
hr=""
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
Randomize()
book=""&dao&"<form action=""bannji.asp?id="&id&"&amp;url="&url&"&amp;sid="&sidd&"&run="& Int((9999) * Rnd() + 1) &""" method=""post"">跳到第<input type=""text"" name=""Page"" value="""" format=""*N"" size=""2"" maxlength=""5""/><input type=""submit"" value=""页"" /></form>"&we0&""
%>
<title>栏目分类管理</title>
</head>
<body>
<!--#include virtual="/css.inc"-->
<%

End Select

%>		
<%=dao%><a href="addbannji.asp?id=<%=id%>&amp;url=<%=url%>&amp;page=<%=page%>&amp;sid=<%=sidd%>">==添加新栏目==</a><%=we0%><%=we%>
<%
	dim rs,sql,page,i
    		Page = Request("page")      '当前页数
    		If Page = "" Then Page = 1
   		If Not IsNumeric(Page) Then Page = 1
    		Page = CLng(Page)
    		If Page < 1 Then Page = 1


	Set Rs = Server.CreateObject("Adodb.Recordset")
		sql="select * from qingtian_showclass where pid="&id&" order by nid asc"
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof)  then
				Rs.PageSize = 15	'一页N条记录
				IF Not IsEmpty(Page) Then
					IF Not IsNumeric(Page) Then		'判断Page是否为数字
						Page=1
					Else
						Page=Cint(Page)		'转换成短整形Integer
					End IF
					IF Page > Rs.PageCount Then
						Rs.AbsolutePage = Rs.PageCount	'设置当前显示页等于最后一页
					ElseIF Page <= 0 Then
						Rs.AbsolutePage = 1		'设置当前页等于第一页
					Else
						Rs.AbsolutePage = Page	'如果大于零,显示当前页等于接收的页数
					End IF
				Else
					Rs.AbsolutePage = 1
				End IF
				Page = Rs.AbsolutePage


		For i=1 to  Rs.PageSize
		If Rs.Eof Then
			exit For
		End If
%>
(<%=rs("nid")%>).<a href="editbannji.asp?id=<%=rs("id")%>&amp;pid=<%=id%>&amp;url=<%=url%>&amp;page=<%=page%>&amp;sid=<%=sidd%>"><%=rs("name")%></a>[<a href="delbannji.asp?id=<%=rs("id")%>&amp;pid=<%=id%>&amp;url=<%=url%>&amp;page=<%=page%>&amp;sid=<%=sidd%>">删除</a>]<br/><%
	 	Rs.MoveNext
	  	Next

       
    		'分页
    		If Page < rs.PageCount Then
    		    Response.Write("<a href='bannji.asp?page=" & Page + 1 & "&amp;id=" & id & "&amp;url=" & url & "&amp;sid=" & sidd & "'>下一页</a>")
    		End If
       
    		If Page > 1 And Page < rs.PageCount Then
    		    Response.Write("|")
    		End If
        
    		If Page > 1 Then
    		    Response.Write("<a href='bannji.asp?page=" & Page - 1 & "&amp;id=" & id & "&amp;url=" & url & "&amp;sid=" & sidd & "'>上一页</a><br/>")
    		Elseif rs.PageCount >1 then
    		    Response.Write("<br/>")
    		End If
            
    		Randomize()
    
    		If rs.PageCount > 2 Then
    		    Response.Write book
     		    Response.Write("[第"&Page&"/总"&rs.PageCount&"页/"&rs.RecordCount&"条]<br/>")
    		End If
                else
                    response.write("该栏目暂无内容！<br/>")
		end if
		Rs.close
	set rs=nothing

%>
<a href='<%=urls%>'>返回来源页</a><%=we0%>

   <%
end Function
%>
